<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        后台管理系统
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="./css/x-admin.css" media="all">
    <style>
        .imgs{display: none;}
    </style>

</head>
<body>
<script type="text/javascript">
function returnto(){
	location.href="index.jsp";
}
</script>

<script>//多张图片预览
function showImg(fileid,target){//给2个参数，其他位置的参数名一致，值就进去了
    var preview = document.querySelector('#'+target);//获取img元素,显示图片位置，根据el表达式('#'+target)
    var file = document.querySelector('#'+fileid).files[0];//根据id拿到文件选择框里面的文件，
    var reader = new FileReader();//创建FileReader接口（把文件放到图片预览框里面）
    reader.onloadend = function () {
        preview.src = reader.result;
    }
    if (file) {
        reader.readAsDataURL(file);
    } else {
        preview.src = "";
    }
}
</script>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>电影列表</cite></a>
              <a><cite>添加电影</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form layui-form-pane" action="insertMovie.do" method="post" enctype="multipart/form-data">
    <input type="hidden" name="flag" value="addMovie">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">电影信息</li>
                <li>SEO信息</li>
                <li>栏目内容</li>
            </ul>

            <div class="layui-tab-content" >
                <div class="layui-tab-item layui-show">
                      <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影名称
                        </label>
                        <div class="layui-input-block">
                            <input type="text"  autocomplete="off" placeholder="请输入电影名称"
                                   class="layui-input" name="name">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影类型
                        </label>
                        <div class="layui-input-block">
                            <input type="text" autocomplete="off" placeholder="请输入电影类型"
                                   class="layui-input" name="type">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影时间
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="time" autocomplete="off"  placeholder="请输入时间"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影时长
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="duration" autocomplete="off" placeholder="请输入电影时长"
                                   class="layui-input">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影地区
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="area" autocomplete="off" placeholder="请输入电影地区"
                                   class="layui-input">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影评分
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="score" autocomplete="off" placeholder="请输入电影评分"
                                   class="layui-input">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影评论人数
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="people" autocomplete="off" placeholder="请输入电影评论人数"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影票房
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="tickets" autocomplete="off" placeholder="请输入电影票房"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>电影演员
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="actor" autocomplete="off" placeholder="请输入电影演员"
                                   class="layui-input">
                        </div>
                    </div>
                    <div  class="layui-form-item">
                    <label class="layui-form-label">
                            <span class='x-red'>*</span>电影简介
                        </label>
					<textarea rows="10" cols="10"style="width: 200px" name="info" ></textarea>
					   
				
                    
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class="x-red">*</span>电影图片
                        </label>
                        <div class="layui-input-inline">
                            <div class="site-demo-upbar">
                                <div class=" layui-upload-button" style="border:#FFFFFF ;">
                                   

                                  上传图片  <input class="layui-upload" type="file"   name="movielogo" id="movielogo" onchange="showImg('movielogo','movie_logo')">

                                </div>
                                <div><span class="layui-upload">
                                    <img src="images/logo.png" width="200" height="200 " id="movie_logo">
                                </span>
                            </div>
                            </div>
                        </div>

                      
                    </div>
                       <div class="layui-form-item">
                        <label  class="layui-form-label">
                            <span class="x-red">*</span>电影演员图片
                        </label>
                        <div class="layui-input-inline">
                            <div class="site-demo-upbar">
                                <div class=" layui-upload-button" style="border:#FFFFFF ;">
                                    上传图片 <input class="layui-upload" type="file"  name="actorlogo" id="actorlogo" onchange="showImg('actorlogo','actor_logo')">

                                </div>
                               <div>
                                   <span class="layui-upload">
                                    <img src="images/logo.png" width="200" height="200 " id="actor_logo">
                                </span>
                                </div>


                            </div>
                        </div>

                      
                    </div>
            
</div>
                    <div class="layui-form-item">
                        <input class="layui-btn" type="submit" value="添加">
                            <input class="layui-btn" type="button" value="返回" onclick="javascript:returnto()">
                        
                      
                            
                        
                    </div>
                </div> 
                  </div> 
    </form>
    
 

</div>

</body>
</html>